<?php
/***************************************************************************
 *
 *   copyright            : (C) 2005 Winds of Storm
 *
 *   $Id: main.php,v 1.15 2007/01/30 21:02:43 nathan Exp $
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

require("config.php");
$skip_header	= 1;
require($libdir . "init." . $phpEx);
require($libdir . "rooms." . $phpEx);

$room_name	= getRoomNameBySession($_REQUEST['sid']);

if ($_REQUEST['cpsp'] == MODE_CLIENT_PULL) {
	$row2		= ",0%";
}

$template = new Template($config['TPL_DIR']);
$template->set_filenames(array('body' => 'main_body.tpl'));

$template->assign_vars(array(
	'ROOM_NAME'	=> $room_name,
	'SID'		=> $_REQUEST['sid'],
	'CPSP'		=> $_REQUEST['cpsp'],

	'FR_ROW2'	=> $row2,

	'CHAT_SERVER'	=> $config['CHAT_SERVER'],
	'CHAT_PORT'	=> $config['CHAT_PORT'],

	'PHPEX'		=> $phpEx
));

switch ($_REQUEST['cpsp']) {
	case MODE_SLIMCHAT:
		$template->assign_block_vars('switch_slim', array());
		break;
	case MODE_CLIENT_PULL:
		$template->assign_block_vars('switch_notslim', array());
		$template->assign_block_vars('switch_notslim.switch_pull', array());
		break;
	case MODE_SERVER_PUSH_PROXY:
		$template->assign_block_vars('switch_notslim', array());
		$template->assign_block_vars('switch_notslim.switch_push_proxy', array());
		break;
	case MODE_SERVER_PUSH:
		$template->assign_block_vars('switch_notslim', array());
		$template->assign_block_vars('switch_notslim.switch_push', array());
		break;
}


$template->pparse('body');

?>
